package com.aaa.tars.controller;

import com.aaa.tars.entity.Pay;
import com.aaa.tars.entity.Remark;
import com.aaa.tars.service.RemarkService;
import com.aaa.tars.util.Page;
import com.aaa.tars.util.Result;
import com.aaa.tars.util.ResultUtil;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @FileName: RemarkController
 * @Description:
 * @Author: ghz
 * @CreateTime:2025/9/12 17:00
 * @Version:1.0.0
 */
@RestController
@RequestMapping("remark")
public class RemarkController {
    @Resource
    private RemarkService remarkService;
    @GetMapping("queryById")
    public Result queryById(Integer remarkId){
        return ResultUtil.success(this.remarkService.queryById(remarkId));
    }
    @PostMapping("queryByPage")
    public Result queryByPage(@RequestBody Page<Remark> page) {
        return ResultUtil.success(this.remarkService.queryByPage(page));
    }
    @PostMapping("insert")
    public Result insert(@RequestBody Remark remark) {
        return ResultUtil.success(this.remarkService.insert(remark));
    }

    /**
     * 编辑数据
     *
     * @param remark 实体
     * @return 编辑结果
     */
    @PutMapping("update")
    public Result update(@RequestBody Remark remark) {
        return ResultUtil.success(this.remarkService.update(remark));
    }

    /**
     * 删除数据
     *
     * @param remarkId 主键
     * @return 删除是否成功
     */
    @DeleteMapping("deleteById")
    public Result deleteById(Integer remarkId) {
        return ResultUtil.success(this.remarkService.deleteById(remarkId));
    }

}